Chris Pollett > Old Classes >
CS185c

( Print View )

Student Corner:
  [Grades Sec3]

  [Submit Sec3]

  [Class Sign Up Sec3]

  [
Lecture Notes]
  [Discussion Board]

Course Info:
  [Texts & Links]
  [Topics/Outcomes]
  [Outcomes Matrix]
  [Grading]
  [HW/Quiz Info]
  [Exam Info]
  [Regrades]
  [Honesty]
  [Additional Policies]
  [Announcements]

HWs and Quizzes:
  [Hw1]  [Hw2]  [Hw3]
  [Hw4]  [Quizzes]  [Project]

Practice Exams:
  [Mid]  [Final]

                           












HW#2 --- last modified February 17 2019 19:31:16..

Solution set.

Due date: Oct 6

Files to be submitted:
  Hw2.zip

Purpose: To write code to preserve app state between invocations. To experiment with log writing as a tool to do debugging. To test out your app on an actual phone.

Related Course Outcomes:

The main course outcomes covered by this assignment are:

LO1 -- Create a working mobile phone application and test it both in a simulator and on a mobile device.

LO2 -- Write a mobile application that involves GUI components and makes use of touch events to manipulate these components.

LO5 -- Write a mobile application that stores program data persistently using an API like sqlite.

Specification:

For this project on the due date I will go around class and verify that you have succeeded in deploying your app on a actual phone, not just the emulator or simulator. As we all know when we are traveling through time, before 1970 mobile phone towers are virtually non-existent. So how can you use your phone without cell towers, if say, you want to visit the Napoleonic era? Simple searches on the internet show you how to make battery chargers for your cell phone, so with some work you can probably use 19th century batteries to keep your phone charged. Luckily, back in time there is less city light pollution, so if you are stranded on a mountain top you can probably use your phone like a flashlight to send signals using Morse code. If you were in the Napoleonic era or earlier, you could safely communicate with your fellow time travelers, as although optical telegraphs existed, Morse code hadn't been invented yet.

Your goal this assignment is to create the Morse Code Visualizer Phone app as an aid for would-be time travelers. Your app should have at least a text field, a send button, an intensity slider, a half screen-full screen segmented control, and a solid gray view area. Depending on the mode of the segmented control -- when it is in full screen mode, but a message isn't sending -- you should also have three buttons labeled with the last three recent messages that have been sent. The main idea of how the app works is that when someone enters text in the text field, a keyboard pops up and they can enter a message to send using "flashlight" Morse code. Clicking outside of the keyboard should make it go away, similarly, hitting return should make it go away. In half-screen mode, clicking send causes a view in the upper half of the screen to toggle from a dull gray to a bright white to make the Morse code of the message. In full-screen mode, the whole screen should become the view used to toggle between these two colors, and the message should be sent. In full screen mode, after the message is sent, the screen returns to having the text field and other controls. The symbols of Morse code can be represented by flashes according to the following list:

  • dit -- one half second bright
  • dash -- one and one half seconds bright
  • intra-character gap -- one half second dark
  • short gap -- one and one half seconds dark
  • medium gap -- three and one half seconds dark

The intensity slider should be usable to control the difference between dark and bright. So at one end of the slider, both dark and bright look dark, and at the other end one gets the maximum difference between bright and dark.

The labels of the last three messages buttons, should be stored persistently, and should reappear correctly when the app is re-launched. Clicking on a button should send the given message. If fewer than three messages have been sent, the behavior of these buttons is up to you. The slider and segmented control positions should also be stored persistently.

A final requirement of your app is that it should support auto-rotation and look decent in both portrait and landscape mode.

Point Breakdown

In class on device demo 1pt
Keyboard and text field works as described 1pt
Segmented control toggles between two modes as described 1pt
Send works as described in half screen and full screen mode 1pt
Morse code basic symbols can each be sent. 1pt
Morse code for alphabet and other characters correctly emitted from app on various test messages. 1pt
Slider works as described 1pt
Recent messages buttons work as described. 1pt
Persistence of button label, sliders, controls between app invocations. 1pt
App supports auto-rotation 1pt
Total10pts